home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / os2 / cenvi2.arj / SOUND.CMD < prev    next >
OS/2 REXX Batch file  |  1993-06-23  |  1KB  |  36 lines

  1. EXTPROC CEnvi
  2. /*******************************************************************
  3.  *** Sound - Sound a specified frequency for specified number of ***
  4.  ***         milliseconds (approximate).                         ***
  5.  *******************************************************************/
  6.  
  7. main(argc,argv)
  8. {
  9.    if ( argc != 3 || 0 == (frequency=atol(argv[1])) || 0 == (duration=atol(argv[2])) )
  10.       Instructions();
  11.    else
  12.       DosBeep(frequency,duration)
  13. }
  14.  
  15. DosBeep(Frequency,Duration)   // play specified Frequency, in Hz, for specified
  16. {                             // duration, in milliseconds
  17.    #define ORD_DOS32BEEP   286
  18.    return DynamicLink("doscalls",ORD_DOS32BEEP,BIT32,CDECL,Frequency,Duration)
  19. }
  20.  
  21. Instructions()
  22. {
  23.    printf("\a\n")
  24.    printf("Sound - Sound a specified tone on the internal speaker for specified time\n")
  25.    printf("\n")
  26.    printf("SYNTAX:  SOUND Freqency Duration\n")
  27.    printf("\n")
  28.    printf("Where:  Frequency     Tone in hertz\n")
  29.    printf("        Duration      In milliseconds\n")
  30.    printf("\n")
  31.    printf("The following example would play middle A for 2 seconds:\n");
  32.    printf("    SOUND 440 2000\n")
  33.    printf("\n")
  34. }
  35.  
  36.